#pragma once
#include <QQuickItem>

class RectangleItem : public QQuickItem
{
    Q_OBJECT
    using Super = QQuickItem;
    Q_PROPERTY(QColor color READ color WRITE setColor NOTIFY colorChanged)

    QML_NAMED_ELEMENT(RectangleItem)
public:
    RectangleItem(QQuickItem *parent = nullptr);
    virtual ~RectangleItem();

    const QColor &color() const;
    void setColor(const QColor &newColor);

signals:
    void colorChanged();

protected:
    virtual QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
private:
    QColor mColor;
    bool mGoemetryChanged = true;
};
